package com.bigdata.controller;

import com.bigdata.entity.vo.DataConnectionRateVO;
import com.bigdata.entity.vo.DataConnectionVO;
import com.bigdata.entity.pojo.Result;
import com.bigdata.service.DataConnectionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/data")
public class DataConnectionController {
    @Autowired
    private DataConnectionService dataConnectionService;
    @GetMapping("/rate/distribution")
    public Result<DataConnectionVO>getRateDistribution(){
        DataConnectionVO dataConnectionVO=dataConnectionService.getAllDataConnections();
        System.out.println(dataConnectionVO);
        return Result.success(dataConnectionVO);
    }
    @GetMapping("/statistic")
    public Result<DataConnectionRateVO>getStatistic(){
        DataConnectionRateVO dataConnectionRateVO=dataConnectionService.getAllDataConnectionRates();
        System.out.println(dataConnectionRateVO);
        return Result.success(dataConnectionRateVO);
    }
}
